package com.chen.service.bill;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chen.dao.bill.BillDao;
import com.chen.pojo.Bill;

@Service("billService")
public class BillServiceImpl implements BillService {
	@Autowired
	private BillDao billDao;
	@Override
	public boolean add(Bill bill) throws Exception {
		return billDao.add(bill) > 0;
	}

	@Override
	public List<Bill> getBillList(String productName,String providerId,String isPayment,int currentPageNo,int pageSize) throws Exception {
		return billDao.getBillList(productName, providerId, isPayment, (currentPageNo - 1) * pageSize, pageSize);
	}

	@Override
	public boolean deleteBillById(String delId) throws Exception {
		return billDao.deleteBillById(delId) > 0;
	}

	@Override
	public Bill getBillById(String id) throws Exception {
		return billDao.getBillById(id);
	}

	@Override
	public boolean modify(Bill bill) throws Exception {
		return billDao.modify(bill) > 0;
	}

	@Override
	public List<Bill> getBillListAll() throws Exception {
		return billDao.getBillListAll();
	}

	@Override
	public int getBillCount() throws Exception {
		return billDao.getBillCount();
	}

	@Override
	public int getBillCountByProviderId(String providerId) throws Exception {
		return billDao.getBillCountByProviderId(providerId);
	}

	@Override
	public int getBillCountList(String productName, String providerId, String isPayment) throws Exception {
		return billDao.getBillCountList(productName, providerId, isPayment);
	}

}
